import request from "@/utils/request";
import { AxiosPromise } from "axios";
import {
  DeviceLogPageResult,
  DeviceLogQuery,
  DeviceListResult,
  DeviceListQuery,
} from "./logtypes";

/**
 * 获取设备日志分页数据
 *
 * @param queryParams
 */
export function getDeviceLogPage(
  queryParams?: DeviceLogQuery
): AxiosPromise<DeviceLogPageResult> {
  return request({
    url: "/api/v1/device/log/page",
    method: "get",
    params: queryParams,
  });
}

/**
 * 获取设备数据
 *
 * @param queryParams
 */
export function getDeviceList(
  queryParams?: DeviceListQuery
): AxiosPromise<DeviceListResult> {
  return request({
    url: "/api/v1/device/list",
    method: "get",
    params: queryParams,
  });
}
